package KC.b2b.conciliacion.manual;

import java.awt.event.*;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

public class ALDesconciliar implements ActionListener {
  private ConciliacionManual appletCon;
  private int int_conciliacionIdTmp;
  private JPanel jpnl_aBorrar;

  public ALDesconciliar(ConciliacionManual appletCon, int int_conciliacionIdTmp, JPanel jpnl_aBorrar) {
    this.appletCon = appletCon;
    this.int_conciliacionIdTmp = int_conciliacionIdTmp;
    this.jpnl_aBorrar = jpnl_aBorrar;
  }

  public void actionPerformed(ActionEvent e) {
    try {
      appletCon.recargarPanelTodo(int_conciliacionIdTmp);
      ConciliacionB.borrarPartidaManual(appletCon.conn.createStatement(), int_conciliacionIdTmp);
      appletCon.recargarTodo();
      appletCon.quitarPanelDesconciliado( jpnl_aBorrar );
      appletCon.sumar_totalesSlctd();
      JOptionPane.showMessageDialog(null, " Registros Desconciliados con Exito ", "Mensaje", JOptionPane.INFORMATION_MESSAGE);
    }catch (Exception ex) {
      JOptionPane.showMessageDialog(null, "Error: \n ("+ex.getMessage()+") ", "Error", JOptionPane.ERROR_MESSAGE);
      ex.printStackTrace(System.out);
    }
  }
}
